import java.io.*;
import java.net.*;
import java.lang.Integer;

public class Sender{

  public static void main(String[] args) throws IOException {

   	  final String SERVER_HOST = "localhost";
	  Integer SERVER_PORT = new Integer(15687);	
	  InetAddress serverInetAddress = InetAddress.getByName(SERVER_HOST);
	  String textToSend = new String("");
      
	  Socket serverSocketAddress = new Socket( serverInetAddress , SERVER_PORT);
	  Boolean done = true;
	  while(done)
	  {
	    
        System.out.println("Enter text :");
        BufferedReader br = new BufferedReader( new InputStreamReader ( System.in ));
	    textToSend = br.readLine();
	
	    PrintWriter output = new PrintWriter(new OutputStreamWriter(serverSocketAddress.getOutputStream()));
	    output.println(textToSend);
	    output.flush();
	  
	    if(1==2){ done = false;}
	    
	  }    
	serverSocketAddress.close();
  }

}

//Fix new sockets issue.